/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.cinfo.siga.datos;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author alumno
 */
@Entity
@Table(name = "MODULO_CALENDARIO")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ModuloCalendario.findAll", query = "SELECT m FROM ModuloCalendario m"),
    @NamedQuery(name = "ModuloCalendario.findByAulCod", query = "SELECT m FROM ModuloCalendario m WHERE m.moduloCalendarioPK.aulCod = :aulCod"),
    @NamedQuery(name = "ModuloCalendario.findByModgCod", query = "SELECT m FROM ModuloCalendario m WHERE m.moduloCalendarioPK.modgCod = :modgCod"),
    @NamedQuery(name = "ModuloCalendario.findByModcFech", query = "SELECT m FROM ModuloCalendario m WHERE m.moduloCalendarioPK.modcFech = :modcFech"),
    @NamedQuery(name = "ModuloCalendario.findByModcTipo", query = "SELECT m FROM ModuloCalendario m WHERE m.moduloCalendarioPK.modcTipo = :modcTipo"),
    @NamedQuery(name = "ModuloCalendario.findByModcIni", query = "SELECT m FROM ModuloCalendario m WHERE m.moduloCalendarioPK.modcIni = :modcIni"),
    @NamedQuery(name = "ModuloCalendario.findByModcFin", query = "SELECT m FROM ModuloCalendario m WHERE m.modcFin = :modcFin"),
    @NamedQuery(name = "ModuloCalendario.findByModcEst", query = "SELECT m FROM ModuloCalendario m WHERE m.modcEst = :modcEst"),
    @NamedQuery(name = "ModuloCalendario.findByModcIng", query = "SELECT m FROM ModuloCalendario m WHERE m.modcIng = :modcIng"),
    @NamedQuery(name = "ModuloCalendario.findByModcSld", query = "SELECT m FROM ModuloCalendario m WHERE m.modcSld = :modcSld"),
    @NamedQuery(name = "ModuloCalendario.findByModcHoras", query = "SELECT m FROM ModuloCalendario m WHERE m.modcHoras = :modcHoras"),
    @NamedQuery(name = "ModuloCalendario.findByModcSist", query = "SELECT m FROM ModuloCalendario m WHERE m.modcSist = :modcSist"),
    @NamedQuery(name = "ModuloCalendario.findByModcDesc", query = "SELECT m FROM ModuloCalendario m WHERE m.modcDesc = :modcDesc")})
public class ModuloCalendario implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected ModuloCalendarioPK moduloCalendarioPK;
    @Column(name = "MODC_FIN")
    @Temporal(TemporalType.TIME)
    private Date modcFin;
    @Column(name = "MODC_EST")
    private Short modcEst;
    @Column(name = "MODC_ING")
    @Temporal(TemporalType.TIME)
    private Date modcIng;
    @Column(name = "MODC_SLD")
    @Temporal(TemporalType.TIME)
    private Date modcSld;
    @Column(name = "MODC_HORAS")
    private Short modcHoras;
    @Column(name = "MODC_SIST")
    private Short modcSist;
    @Column(name = "MODC_DESC")
    private Short modcDesc;
    @JoinColumn(name = "MODG_COD", referencedColumnName = "MODG_COD", insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private ModuloGrupo moduloGrupo;
    @JoinColumn(name = "DOCE_COD", referencedColumnName = "DOCE_COD")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Docente doceCod;
    @JoinColumn(name = "AUL_COD", referencedColumnName = "AUL_COD", insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Aula aula;

    public ModuloCalendario() {
    }

    public ModuloCalendario(ModuloCalendarioPK moduloCalendarioPK) {
        this.moduloCalendarioPK = moduloCalendarioPK;
    }

    public ModuloCalendario(int aulCod, String modgCod, Date modcFech, short modcTipo, Date modcIni) {
        this.moduloCalendarioPK = new ModuloCalendarioPK(aulCod, modgCod, modcFech, modcTipo, modcIni);
    }

    public ModuloCalendarioPK getModuloCalendarioPK() {
        return moduloCalendarioPK;
    }

    public void setModuloCalendarioPK(ModuloCalendarioPK moduloCalendarioPK) {
        this.moduloCalendarioPK = moduloCalendarioPK;
    }

    public Date getModcFin() {
        return modcFin;
    }

    public void setModcFin(Date modcFin) {
        this.modcFin = modcFin;
    }

    public Short getModcEst() {
        return modcEst;
    }

    public void setModcEst(Short modcEst) {
        this.modcEst = modcEst;
    }

    public Date getModcIng() {
        return modcIng;
    }

    public void setModcIng(Date modcIng) {
        this.modcIng = modcIng;
    }

    public Date getModcSld() {
        return modcSld;
    }

    public void setModcSld(Date modcSld) {
        this.modcSld = modcSld;
    }

    public Short getModcHoras() {
        return modcHoras;
    }

    public void setModcHoras(Short modcHoras) {
        this.modcHoras = modcHoras;
    }

    public Short getModcSist() {
        return modcSist;
    }

    public void setModcSist(Short modcSist) {
        this.modcSist = modcSist;
    }

    public Short getModcDesc() {
        return modcDesc;
    }

    public void setModcDesc(Short modcDesc) {
        this.modcDesc = modcDesc;
    }

    public ModuloGrupo getModuloGrupo() {
        return moduloGrupo;
    }

    public void setModuloGrupo(ModuloGrupo moduloGrupo) {
        this.moduloGrupo = moduloGrupo;
    }

    public Docente getDoceCod() {
        return doceCod;
    }

    public void setDoceCod(Docente doceCod) {
        this.doceCod = doceCod;
    }

    public Aula getAula() {
        return aula;
    }

    public void setAula(Aula aula) {
        this.aula = aula;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (moduloCalendarioPK != null ? moduloCalendarioPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ModuloCalendario)) {
            return false;
        }
        ModuloCalendario other = (ModuloCalendario) object;
        if ((this.moduloCalendarioPK == null && other.moduloCalendarioPK != null) || (this.moduloCalendarioPK != null && !this.moduloCalendarioPK.equals(other.moduloCalendarioPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.cinfo.siga.datos.ModuloCalendario[ moduloCalendarioPK=" + moduloCalendarioPK + " ]";
    }
    
}
